package com.itly.rwgh.service.Impl;

import com.itly.rwgh.dao.TwentyFourHourWeatherDao;
import com.itly.rwgh.pojo.DataTemp;
import com.itly.rwgh.service.TwentyFourHourWeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import static com.itly.rwgh.utils.GetWeathers.sendRequest;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 罗言
 * @Version: 1.0
 * @Date: 2023-11-21-14:25
 * @Description:
 */
@Service
public class TwentyFourHourWeatherServiceImpl implements TwentyFourHourWeatherService {

    @Autowired
    private TwentyFourHourWeatherDao dao;
    @Override
    public String getData(String url, String type) {
        return sendRequest(url, type);
    }

    @Override
    public DataTemp getInfo(int id) {
        return dao.getInfo(id);
    }

    @Override
    public boolean update(String data, int id) {
        return dao.update(data, id) > 0;
    }
}
